﻿using System;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EasyBackup.Utils
{
    static class AppTimer
    {
        public static void Init(Timer timer)
        {
            timer.Tick += Tick;                        
            timer.Interval = 1000 * 60; //60 seconds            
            timer.Enabled = true;        
        }

        private static void Tick(object sender, EventArgs e)
        {
            Task.Run(() => Schedule.Check(DateTime.Now));            
        }
    }
}
